from langchain_openai import ChatOpenAI
from langchain_core.messages import HumanMessage, AIMessage

# 选择调用的OpenAI的模型
model = ChatOpenAI(
    base_url="https://api.gptsapi.net/v1",
    api_key="sk-WmM426a0b2ce516cdfab7a58d6562fe2d78cbcd5288IYPXT",
    model="gpt-3.5-turbo"
)

response = model.invoke([
    HumanMessage(content="你好。我叫王大明，你是谁？"),
    AIMessage(content='我是一个AI语言模型，'),
    HumanMessage(content="你好。你是谁？我是谁？"),
])

print(response)